import React from 'react';
import { Radio } from 'antd';

interface IVRadioProps {
  options: { label: string; value: string }[];
  value: any;
  onChange: (value: any) => void;
  [key: string]: any;
}
const VRadio: React.FC<IVRadioProps> = ({
  options = [],
  value,
  onChange,
  ...resetProps
}) => {
  return (
    <Radio.Group onChange={e => onChange(e.target.value)} {...resetProps}>
      {options.map(item => {
        return <Radio value={item.value}>{item.label}</Radio>;
      })}
    </Radio.Group>
  );
};

export default VRadio;
